1 . Field of the Invention
The present invention relates to a method and apparatus related to a serial interface, and more particularly to a method and apparatus for avoiding a bi-directional signal fighting of a serial interface.
2 . Description of the Related Art
A standard serial peripheral interface (SPI) comprises a serial clock signal (SCK) line, a serial data input (SI) line, and a serial data output (SO) line for data transmission. Referring to the waveform in FIG. 1, SCK represents the serial clock signal of the serial clock signal line, SI represents the serial data input line signal, and SO represents the serial data output line signal. Wherein, the SPI standard includes a transmission protocol. In the apparatus, the serial data input line outputs a data according to the positive edge-trigger of each clock of the serial clock signal SCK. Moreover, the serial data output line outputs a data according to the negative edge-trigger of each clock of the serial clock signal SCK. At the beginning of the transmission, the serial input line outputs an 8-bit signal, i.e., the Bit7, Bit6, Bit5, Bit4, Bit3, Bit2, Bit1, and Bit0 shown in the SI waveform of FIG. 1, according to the rising edge of the serial clock signal SCK. In addition, the serial output line outputs an 8-bit signal, i.e., the Bit7, Bit6, Bit5, Bit4, Bit3, Bit2, Bit1, and Bit0 shown in the SO waveform of FIG. 1, according to the falling edge of the second clock signal SCK.
However, it had been considered that the serial input data line and the serial output data line be merged to save pin-count by using the bi-directional signal line transmission. In the standard serial transmission interface, there is no bi-directional signal switch mechanism. While the directions of the signals of the bi-directional data line are switched, signal fighting may occur due to various delays. As shown in the waveform of FIG. 2, when the transmission starts, the serial clock signal SCK begins action. When the input SI of the data line is switched from input SI to output SO, the signal fighting shown in this figure occurs. During the bi-directional signal line transmission, both apparatuses may be driven simultaneously. If the signal fighting occurs, the circuit is subject to damage due to short circuit. Thus, one approach is to change the transmission protocol. The signal turn-around cycle is added in the protocol. This approach, however, has disadvantages. For example, the signal turn-around cycle is not compatible with the original standard serial interface protocol, the transmission time is increased, and the transmission efficiency is reduced.